<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<title>Poker</title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" />
    <link 	href="http://cdn.kendostatic.com/2011.3.1407/styles/kendo.common.min.css"
	rel="stylesheet" />
    <link 	href="http://cdn.kendostatic.com/2011.3.1407/styles/kendo.default.min.css" 	rel="stylesheet" />
    <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
    <script src="http://cdn.kendostatic.com/2011.3.1407/js/kendo.all.min.js">
    </script>

</head>

<body>

	<div>
		<form:form commandName="pokerGameForm" method="post">
			<p>
				<label>Your Hand :</label>
				<form:input path="yours" />
			</p>
			<p>
				<label>His Hand :</label>
				<form:input path="his" />
			</p>
			<p>
				<input type="submit" value="Compare !" />
			</p>
		</form:form>
	</div>	
	
	
	<div>
		Resultat : ${myResult}
	</div>
	
	<table id="tableGames">
	
	<tr>
		<th># Partie</th>
		<th>Me</th>
		<th>Him</th>
		<th>Score</th>
	</tr>
	<c:forEach items="${games}" var="game">
		<tr>
			<td>${game.id}</td>
			<td>${game.yourHand}</td>
			<td>${game.hisHand}</td>
			<td>${game.result}</td>
		</tr>
	</c:forEach>
	

</table>	
	
<script type="text/javascript">
$(document).ready(function(){
    $("#tableGames").kendoGrid({
        scrollable: true,
        sortable: true,
     });
});	
</script>

	<div>
		YourTotalScore : ${score}
	</div>
	
	<div>
		HisTotalScore : ${-score}
	</div>

</body>
</html>
